package com.ybkj.daijia.server.model;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 司机充值记录
 *
 * @author Shine
 */

public class DriverPaymentsRecord extends Base {

    /**
     * 充值方式
     */
    public static final String RECHARGE_TYPE_ADMIN = "admin_recharge";// 人工充值
    public static final String CONSUMED_TYPE_ADMIN = "admin_consumed";// 人工扣费
    public static final String RECHARGE_TYPE_ALIPAY = "alipay";// 支付宝充值
    public static final String RECHARGE_TYPE_WX = "weixin";// 微信充值
    public static final String RECHARGE_TYPE_UNIONPAY = "unionpay";// 银联支付充值 no
    public static final String RECHARGE_TYPE_BESTPAY = "bestpay";// 翼支付充值 no
    public static final String RECHARGE_TYPE_ORDER = "order_recharge";// 订单提成 {0.6%- 0.0}
    public static final String CONSUMED_TYPE_ORDER = "order_consumed";// 公司抽成 no 没有使用
    public static final String RECHARGE_TYPE_BAOXIAO = "baoxiao";// 费用报销 no
    public static final String RECHARGE_TYPE_MODIFY = "modify_recharge";// 订单修改金额 no
    public static final String CONSUMED_TYPE_MODIFY = "modify_consumed";// 订单修改金额 no
    public static final String RECHARGE_TYPE_ORDER_GUOLU = "guolu";// 过路费
    public static final String CONSUMEDRECORD_TYPE_XINXI = "xinxi";//保险费/信息费;
    public static final String CONSUMEDRECORD_TYPE_HELPPAY = "helppay";//代付;
    public static final String CONSUMEDRECORD_TYPE_WORKCAR = "workcar";//工作车支付;
    public static final String RECHARGE_TYPE_REBATE = "rebate";// 推荐提成
    public static final String RECHARGE_TYPE_REBATE_REWARD = "reb_reward";// 推荐奖励
    public static final String RECHARGE_TYPE_REBATE_REWARD_LOSS = "reb_reward_lo";// 补发推荐奖励
    public static final String DELETE_TYPE_REBATE = "sub_rebate";// 推荐提成扣除
    public static final String RECHARGE_TYPE_REWARD = "reward_recharge";// 服务人员奖励
    public static final String CONSUMEDRECORD_TYPE_ENCHASHMENT = "enchashment";// 服务人员提现
    public static final String CONSUMEDRECORD_TYPE_DRIVER_REBATE_ENCHASHMENT = "enchashment_driver_rebate";// 服务人员推荐奖励提现
    public static final String RECHARGE_TYPE_ENCHASHMENT = "enchashment_recharge";// 服务人员提现驳回
    public static final String RECHARGE_TYPE_DRIVER_REBATE_ENCHASHMENT = "enchashment_recharge";// 服务人员推荐奖励提现驳回
    public static final String RECHARGE_TYPE_THANKS = "thanks";// 感谢费
    public static final String RECHARGE_TYPE_GOODS = "goods";// 商品费
    public static final String WX_MANAGER_FEE = "wx_manager_fee";// 客户经理提成承担费用
    public static final String CHANGE_MONEY_TO_REBATE = "chToRebate";
    public static final String CHANGE_MONEY_TO_REBATE_T = "chToRebate_t";
    public static final int ORDER_TYPE_DAIJIA = 0;
    public static final int ORDER_TYPE_ZHUANCHE = 1;
    public static final int ORDER_TYPE_PAOTUI = 2;
    public static final int ORDER_TYPE_ZUCHE = 3;
    public static final int ORDER_TYPE_FREIGHT = 4;
    public static final int ORDER_TYPE_ZHUANXIAN = 5;
    public static final int ORDER_TYPE_GASSTATION = 6;
    public static final String INFOFEE_TYPE_INFO = "info";// 信息费
    public static final String INFOFEE_TYPE_DJX = "djx";// 代驾险
    public static final String INFOFEE_TYPE_YWX = "ywx";// 意外险
    /**
     * 操作人
     */
    public static final String OPERATING_SYS = "系统";// 系统
    public static final int DIFFERENT_POSITIVE = 0;//充值记录
    public static final int DIFFERENT_NEGATIVE = 1;//扣费记录
    public static final int DIFFERENT_REWARD = 2;//提成记录
    public static final int DRIVER_TUIJIAN_JIANGLI = 3;//奖励记录
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private Long driverId;

    private String driverUserName;

    private String driverRealName;

    private String driverPhone;

    private Long driverCompanyId;

    private BigDecimal money;// 金额

    private BigDecimal afterMoney;// 操作后后余额

    private String memo;// 备注

    private Long orderId;// 订单id

    private String orderNumber;// 订单号

    private Integer orderType;//订单类型  0代驾,1专车,2跑腿,3租车,4货运

    private Long orderCompanyId;

    private String recordType;// 记录方式

    private String infoFeeType;//信息费info 代驾险djx 意外险ywx

    private String operating;// 操作人

    private Integer rcType;//充值记录 or 扣费记录

    private Date happend;

    private HelpPayRecord helppayRecordMemo; //关联查询

    private BigDecimal helppay;//代付金额

    public static String getRecordTypeStr(String recordType) {
        if (recordType.equals(RECHARGE_TYPE_ADMIN)) {
            return "人工充值";
        } else if (recordType.equals(CONSUMED_TYPE_ADMIN)) {
            return "人工扣费";
        } else if (recordType.equals(RECHARGE_TYPE_ALIPAY)) {
            return "支付宝充值";
        } else if (recordType.equals(RECHARGE_TYPE_WX)) {
            return "微信充值";
        } else if (recordType.equals(RECHARGE_TYPE_UNIONPAY)) {
            return "银联充值";
        } else if (recordType.equals(RECHARGE_TYPE_BESTPAY)) {
            return "翼支付充值";
        } else if (recordType.equals(RECHARGE_TYPE_ORDER)) {
            return "订单金额";
        } else if (recordType.equals(CONSUMED_TYPE_ORDER)) {
            return "公司抽成";
        } else if (recordType.equals(RECHARGE_TYPE_BAOXIAO)) {
            return "费用报销";
        } else if (recordType.equals(RECHARGE_TYPE_MODIFY)) {
            return "订单修改金额";
        } else if (recordType.equals(CONSUMED_TYPE_MODIFY)) {
            return "订单修改金额";
        } else if (recordType.equals(RECHARGE_TYPE_REBATE)) {
            return "推荐提成";
        } else if (recordType.equals(RECHARGE_TYPE_REBATE_REWARD)) {
            return "推荐奖励";
        } else if (recordType.equals(RECHARGE_TYPE_REBATE_REWARD_LOSS)) {
            return "补发推荐奖励";
        } else if (recordType.equals(RECHARGE_TYPE_ORDER_GUOLU)) {
            return "过路费";
        } else if (recordType.equals(CONSUMEDRECORD_TYPE_XINXI)) {
            return "保险费/信息费";
        } else if (recordType.equals(CONSUMEDRECORD_TYPE_HELPPAY)) {
            return "代付";
        } else if (recordType.equals(CONSUMEDRECORD_TYPE_WORKCAR)) {
            return "工作车支付";
        } else if (recordType.equals(RECHARGE_TYPE_REWARD)) {
            return "服务人员奖励";
        } else if (recordType.equals(CONSUMEDRECORD_TYPE_ENCHASHMENT)) {
            return "申请余额提现";
        } else if (recordType.equals(RECHARGE_TYPE_ENCHASHMENT)) {
            return "申请余额提现驳回";
        } else if (recordType.equals(RECHARGE_TYPE_THANKS)) {
            return "感谢费";
        } else if (recordType.equals(RECHARGE_TYPE_GOODS)) {
            return "商品费";
        } else if (recordType.equals(WX_MANAGER_FEE)) {
            return "客户经理提成费";
        } else if (recordType.equals(DELETE_TYPE_REBATE)) {
            return "司机推荐提成扣除";
        } else if (recordType
            .equals(DriverPaymentsRecord.CONSUMEDRECORD_TYPE_DRIVER_REBATE_ENCHASHMENT)) {
            return "推荐红包奖励";
        } else if (recordType.equals(CHANGE_MONEY_TO_REBATE)) {
            return "推荐红包金额转入红包余额";
        } else if (recordType.equals(CHANGE_MONEY_TO_REBATE_T)) {
            return "推荐奖励转推荐红包总额";
        }
        return "未知";
    }

    public static void main(String[] args) {
        DriverPaymentsRecord driverPaymentsRecord = new DriverPaymentsRecord();
        driverPaymentsRecord.setMemo("推荐客户【先生/女士】phone[17381823840]奖励1.0元。");
        System.out.println(driverPaymentsRecord.getPassengerPhone());
    }

    public BigDecimal getHelppay() {
        return helppay;
    }

    public void setHelppay(BigDecimal helppay) {
        this.helppay = helppay;
    }
/*	@Override
	public String toString() {
		return "DriverPaymentsRecord{" +
				"driverId=" + driverId +
				", helpPayRecord=" + helpPayRecord +
				", id=" + id +
				", created=" + created +
				'}';
	}*/

    public HelpPayRecord getHelppayRecordMemo() {
        return helppayRecordMemo;
    }

    public void setHelppayRecordMemo(HelpPayRecord helppayRecordMemo) {
        this.helppayRecordMemo = helppayRecordMemo;
    }

    public Date getHappend() {
        return happend;
    }

    public void setHappend(Date happend) {
        this.happend = happend;
    }

    public Long getDriverId() {
        return driverId;
    }

    public void setDriverId(Long driverId) {
        this.driverId = driverId;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public String getOperating() {
        return operating;
    }

    public void setOperating(String operating) {
        this.operating = operating;
    }

    public BigDecimal getAfterMoney() {
        return afterMoney;
    }

    public void setAfterMoney(BigDecimal afterMoney) {
        this.afterMoney = afterMoney;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public String getDriverUserName() {
        return driverUserName;
    }

    public void setDriverUserName(String driverUserName) {
        this.driverUserName = driverUserName;
    }

    public String getDriverRealName() {
        return driverRealName;
    }

    public void setDriverRealName(String driverRealName) {
        this.driverRealName = driverRealName;
    }

    public Long getDriverCompanyId() {
        return driverCompanyId;
    }

    public void setDriverCompanyId(Long driverCompanyId) {
        this.driverCompanyId = driverCompanyId;
    }

    public Long getOrderCompanyId() {
        return orderCompanyId;
    }

    public void setOrderCompanyId(Long orderCompanyId) {
        this.orderCompanyId = orderCompanyId;
    }

    public String getRecordType() {
        return recordType;
    }

    public void setRecordType(String recordType) {
        this.recordType = recordType;
    }

    public String getInfoFeeType() {
        if (null == infoFeeType) {
            return INFOFEE_TYPE_INFO;
        }
        return infoFeeType;
    }

    public void setInfoFeeType(String infoFeeType) {
        this.infoFeeType = infoFeeType;
    }

    public Integer getRcType() {
        return rcType;
    }

    public void setRcType(Integer rcType) {
        this.rcType = rcType;
    }

    public String getDriverPhone() {
        return driverPhone;
    }

    public void setDriverPhone(String driverPhone) {
        this.driverPhone = driverPhone;
    }

    public String getRecordTypeStr() {
        return getRecordTypeStr(recordType);
    }

    public String getPassengerPhone() {
        int a = memo.indexOf("[");
        int b = memo.indexOf("]");
        return memo.substring(a + 1, b);
    }
}
